﻿<!DOCTYPE html>
<html>
<head>
    <title>JS Operators Exercise 1</title>
    <link href="styles/js-console.css" rel="stylesheet" />
</head>
<body>
    <h1>Check if number is even or odd:</h1>
    <label for="input-number">Number:</label>
    <input type="number" id="input-number"/>
    <button onclick="checkNumber()">Check Number</button>
    <div id="js-console"></div>
    <script src="scripts/js-console.js"></script>
    <script>
        function checkNumber()
        {
            var num;
            num = jsConsole.readInteger("#input-number");
            if ((num % 2) == 0)
            {
                jsConsole.writeLine(num + " is even");
            }
            else
            {
                jsConsole.writeLine(num + " is odd");
            }
        }
    </script>
</body>
</html>
